package ua.com.globallogic.basecamp.krasnyanskiy.webcrawler;

public class URLValidator {

    private String[] args;

    public URLValidator(String... args) {
        this.args = args;
    }

    boolean validate (){
        if (args.length == 2) {
            if (args[0] == null || args[1] == null){
                return false;
            }
            if (args[0].startsWith("www")){
                args[0] = "http://" + args[0];
                return true;
            }
            if (!args[0].startsWith("http://")){
                return false;
            }
        }
        return true;
    }
}
